#ifndef CABILITY_H_INCLUDED
#define CABILITY_H_INCLUDED

#include "LON.h"

class CBattle;
class CMinionNode;

//! Enumberation for different types of ability
enum ABILITY_TYPE
{
  //! Non Targeted Ability
  ABL_NONE = 0,

  //! Minion / Object Targeted Ability
  ABL_TARGET,

  //! Point / Vector Targeted Ability
  ABL_POINT,

  //! TODO: Passive
  ABL_PASSIVE

};

class CAbility
{
  public:
    //! Constructor : Define Ability Data Here
    CAbility();

    //! Destructor
    virtual ~CAbility();

    //! The function to be called when the ability is used
    //! Returns true if the ability is activated successfully
    virtual bool effect() = 0;

    //! Set the battle information (for some ability only)
    void setBattle(CBattle *battle);

    //! Set the ability user / caster
    void setCaster(CMinionNode *caster);

    //! Set the ability target (For ABL_TARGET)
    void setTarget(CMinionNode *target);

    //! Set the ability location (For ABL_POINT)
    void setPoint(vector3df &point);

    //! Gets
    s16 getCost();

    f32 getRange();

    f32 getRadius();

    s32 getDelay();

    ABILITY_TYPE getType();

    bool isTargeted();

  protected:
    // Ability Type
    ABILITY_TYPE type;

    // The mp cost of the ability
    s16 cost;

    // Range of the ability
    f32 range;

    // Radius of the AOE ability ( 0 for non AOE spell )
    f32 radius;

    // Duration of the effect ( 0 for special cases )
    s32 duration;

    // Delay of the ability
    s32 delay;

    // Special Parameter(s) for ability. Used for detalls such as damage
    f32 *param;

    //! Not sure if this is needed yet
    //u32 paramCount;

    // Pointer to the Battle
    CBattle* battle;

    // Source / Caster of the Ability
    CMinionNode* caster;

    // Target Unit for ABL_TARGET
    CMinionNode* target;

    // Position for ABL_POINT
    vector3df point;

};

#endif // CABILITY_H_INCLUDED
